<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1,user-scalable=no" />
	<title>排污口详情</title>
	<link rel="stylesheet" href="css/sm.css">
	<link rel="stylesheet" href="css/module.css">
	<link rel="stylesheet" href="dist/idangerous.swiper.css">
	<script src="js/jquery-1.10.1.min.js"></script>
	<script src="dist/idangerous.swiper.min.js"></script>

	<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
		  integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
		  crossorigin=""/>
<!--	<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"-->
<!--			integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="-->
<!--			crossorigin=""></script>-->
	<script src="js/leaflet.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="css/sm-extend.css">
	<link rel="stylesheet" href="css/demos.css">
	<link rel="stylesheet" type="text/css" href="css/LCalendar.css" />
	<script src="zepto.min.js"></script>
	<script src="js/LCalendar.js" type="text/javascript" charset="utf-8"></script>
	<script src="weui/lib/jquery-2.1.4.js"></script>
	<script src="weui/js/jquery-weui.min.js"></script>
	<script type="text/javascript" src='leaflet.ChineseTmsProviders.js'></script>
	<script type="text/javascript" src='leaflet.mapCorrection.min.js'></script>


	<style>
		/* Demo Styles */
		body {
			margin: 0;
			font-family: Arial, Helvetica, sans-serif;
			font-size: 13px;
			line-height: 1.5;
		}
		.swiper-container {
			width: 90vw;
			height: 250px;
			color: #fff;
			text-align: center;
			border-radius:8px;
		}
		.red-slide {
			background: #ca4040;
		}
		.blue-slide {
			background: #4390ee;
		}
		.orange-slide {
			background: #ff8604;
		}
		.green-slide {
			background: #49a430;
		}
		.pink-slide {
			background: #973e76;
		}
		.swiper-slide .title {
			width:100%;
			height:100%
		}
		.swiper-slide .title img{
			width:100%;
			height:100%;
		}
		.swiper-slide p {
			font-style: italic;
			font-size: 25px;
		}
		.pagination {
			position: absolute;
			z-index: 20;
			left: 10px;
			bottom: 10px;
		}
		.swiper-pagination-switch {
			display: inline-block;
			width: 8px;
			height: 8px;
			border-radius: 8px;
			background: #555;
			margin-right: 5px;
			opacity: 0.8;
			border: 1px solid #fff;
			cursor: pointer;
		}
		.swiper-active-switch {
			background: #fff;
		}
		.swiper-dynamic-links {
			text-align: center;
		}
		.swiper-dynamic-links a {
			display: inline-block;
			padding: 5px;
			border-radius: 3px;
			border: 1px solid #ccc;
			margin: 5px;
			font-size: 12px;
			text-decoration: none;
			color: #333;
			background: #eee;
		}
	</style>
</head>
<body onload="myfunction()">

<div class="content">

	<div class="weui-panel weui-panel_access">
		<div style="margin-top:25px;width: 100px;height: 25px;"><span style="color: #3189f1;font-weight:bold;margin-left: 15px">基础信息</span></div>
		<div class="list-block">
			<ul class="form-ul">
				<li><span class="title-text">排污口名称:</span><span id="outfallNm"></span></li>
				<li><span class="title-text">排污口编码:</span><span id="outfallClassifyCd"></span></li>
				<li id="fl"><span class="title-text">排污口类型:</span><span id="outfallType"></span></li>
				<li id="fl1"><span class="title-text">排污口分类:</span><span id="outfallType1"></span></li>
				<li><span class="title-text small">河长信息:</span><span id="rivers"></span></li>
				<li><span class="title-text small">排放标准:</span><span id="dischargeStandard"></span></li>
				<li><span class="title-text max">排入水体名称:</span><span id="waveNm"></span></li>
<!--				<li><span class="title-text max">排污口责任主体:</span><span id="dutyName" style="width:calc(100% - 4.8rem);float:right;display:block"></span></li>-->
				<li><span class="title-text max1">排污口责任主体:</span><span id="dutyName" ></span></li>
<!--				<li id="cy"><span class="title-text max">排污口责任主体:</span><span id="sDutyName"></span></li>-->
				<li style="border-bottom:none"><span class="title-text small">现场照片:</span></li>
				<div class="swiper-container">
					<div class="swiper-wrapper"></div>
					<div class="pagination"></div>
				</div>
			</ul>
		</div>
	</div>

	<div class="weui-panel weui-panel_access" >
		<div style="margin-top: 25px;width: 100px;height: 25px;"><span style="color: #3189f1;font-weight:bold;margin-left: 15px">位置信息</span></div>
		<div class="list-block">
			<ul class="form-ul">
				<!--				<li>-->
				<!--					<div class="item-content">-->
				<!--						<div class="item-inner">-->
				<!--							<div class="item-title label">所属水系:</div>-->
				<!--							<div class="item-input">-->
				<!--								<input type="text" id="outfallWave" value="" placeholder="-">-->
				<!--							</div>-->
				<!--						</div>-->
				<!--					</div>-->
				<!--				</li>-->

				<li ><span class="title-text mini">经度:</span><span id="jd"></span></li>
				<li><span class="title-text mini">纬度:</span><span id="wd"></span></li>
				<li><span class="title-text small">详细地址:</span><span id="address"></span></li>

				<li  style="border-bottom:none"><span class="title-text small">水系图:</span></li>
				<div id="waterHomeBaiduMap"
					 style=" height: 230px;" class="swiper-container">
				</div>
			</ul>
		 </div>
	</div>

	<div class="weui-panel weui-panel_access" >
<!--				<button class="bubtn btn1"  onclick="showSamplingTankList()" style="float: right;margin:0;">+ 添加在线监测</button>-->

		<div style="margin-top: 25px;width: 100px;height: 25px;"><span style="color: #3189f1;font-weight:bold;margin-left: 15px;line-height:25px;">监测信息</span></div>

		<div class="weui-cell">
			<!--			<div  style="width:10%;position: relative;top: -2px;">-->
			<!--				<svg t="1637549126918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5466" width="20" height="20"><path d="M517.0176 916.1728H118.9888c-35.0208 0-63.6928-9.5232-86.016-31.8464-9.5232-9.5232-12.6976-22.3232-12.6976-35.0208V244.3264c0-35.0208 38.1952-63.6928 82.7392-66.8672h82.7392c12.6976 0 19.1488-3.1744 19.1488-12.6976V139.264c6.3488-25.4976 25.4976-38.1952 57.344-38.1952 25.4976 0 44.544 15.872 47.7184 41.3696v3.1744c3.1744 35.0208 3.1744 35.0208 44.544 35.0208h347.0336c15.872 0 22.3232-3.1744 22.3232-15.872v-22.3232c3.1744-25.4976 25.4976-38.1952 54.1696-38.1952s47.7184 15.9744 50.8928 38.1952c0 12.6976-6.3488 28.672 3.1744 35.0208 12.6976 6.3488 31.8464 3.1744 47.7184 3.1744h47.7184c47.7184 3.1744 86.016 31.8464 86.016 70.0416v598.6304c0 41.3696-41.3696 70.0416-98.7136 73.216-127.1808-6.3488-264.0896-6.3488-397.824-6.3488z m3.1744-544.4608H122.1632c-15.872 0-22.3232 3.1744-22.3232 15.872v439.3984c0 19.1488 9.5232 22.3232 28.672 22.3232h783.2576c28.672 0 28.672 0 28.672-22.3232v-436.224c0-15.9744-3.1744-19.1488-22.3232-19.1488H520.192z m0 0" p-id="5467" fill="#dbdbdb"></path><path d="M271.872 753.8688h-50.9952c-22.3232 0-31.8464-9.5232-35.0208-25.4976v-54.1696c0-15.872 12.6976-25.4976 31.8464-25.4976h108.2368c22.3232 0 31.8464 9.5232 31.8464 28.672v50.8928c0 15.872-9.5232 25.4976-31.8464 25.4976h-54.0672z m248.32 0h-50.9952c-22.3232 0-35.0208-9.5232-35.0208-25.4976v-50.8928c0-19.1488 9.5232-25.4976 31.8464-28.672h105.0624c19.1488 0 31.8464 9.5232 31.8464 25.4976v54.1696c0 15.9744-12.6976 25.4976-31.8464 25.4976H520.192z m248.32-105.1648h54.1696c19.1488 0 31.8464 9.5232 28.672 25.4976v57.344c0 15.872-12.6976 25.4976-31.8464 25.4976H711.2704c-19.1488 0-31.8464-9.5232-31.8464-25.4976v-54.1696c0-15.872 12.6976-25.4976 31.8464-25.4976 19.0464-6.3488 38.1952-3.1744 57.2416-3.1744zM520.192 572.3136h-54.1696c-22.3232 0-31.8464-6.3488-31.8464-25.4976v-57.344c0-15.872 9.5232-22.3232 28.672-22.3232h111.4112c19.1488 0 28.672 9.5232 31.8464 25.4976v54.1696c0 15.872-9.5232 25.4976-31.8464 25.4976H520.192zM271.872 467.2512h54.1696c19.1488 0 31.8464 9.5232 31.8464 22.3232v57.344c0 15.872-9.5232 22.3232-28.672 22.3232H217.7024c-19.1488 0-28.672-6.3488-28.672-22.3232V486.4c0-15.872 12.6976-22.3232 31.8464-22.3232 15.9744 3.1744 31.8464 3.1744 50.9952 3.1744z m493.4656 105.0624h-54.1696c-19.1488 0-31.8464-9.5232-31.8464-25.4976v-57.344c0-15.872 9.5232-22.3232 28.672-22.3232h111.4112c19.1488 0 28.672 9.5232 28.672 22.3232v57.344c0 12.6976-9.5232 22.3232-28.672 22.3232-15.872 3.1744-34.9184 3.1744-54.0672 3.1744z m0 0" p-id="5468" fill="#dbdbdb"></path></svg>-->
			<!--			</div>-->
			<!--			<div class="weui-cell__bd" style="width:40%">-->
			<!--			  <input class="weui-input font-input date-input" type="text" data-toggle='date' id="startTime"  placeholder="选择起始日期" />-->
			<!--			</div>-->
			<!--			<div  style="width:10%;text-align: center;color:#aaa">至</div>-->
			<!--			<div class="weui-cell__bd"  style="width:40%">-->
			<!--			  <input class="weui-input font-input date-input" type="text" data-toggle='date' id="endTime"  placeholder="选择截止日期" />-->
			<!--			</div>-->
		</div>
		<!--		<div  style="padding:5px 0; overflow: hidden; border-bottom: 1px solid #d9d9d9;">-->
		<!--			<button class="bubtn btn" style="float:right"  onclick="onQuery()">查询</button>-->
		<!--			<button class="bubtn btn2" style="float:right" onclick="onResert()">重置</button>-->
		<!--		</div>-->
		<div style="margin-top:6px">
			<view class="table" >
				<view class="tr">
					<view class="th">因子</view>
					<view class="th">监测时间</view>
					<view class="th">监测数值</view>
					<view class="th">标准值上下限</view>
				</view>
				<div id="addList">
				</div>
			</view>
		</div>
	</div>
	<div class="weui-panel weui-panel_access" >
		<div style="margin-top: 25px;width: 100px;height: 25px;"><span style="color: #3189f1;font-weight:bold;margin-left: 15px">监督电话</span></div>
		<div class="list-block">
			<ul class="form-ul">

				<li><span class="title-text small" >河长电话:</span><span style="display: block;text-align: center;" id="riversPhone"></span></li>
				<li><span class="title-text max">举报电话:</span><span style="display: block;text-align: center;margin-right: 30px">12345</span></li>
			</ul>

		</div>
	</div>
<!--	<div class="footer-box">-->
<!--		<p><span class="title-text max">生态环境部门:</span><span>12369</span></p>-->
<!--		<p><span class="title-text small">河长电话:</span><span id="riversPhone"></span></p>-->
<!--	</div>-->
</div>
<!--<div class="swiper-container">-->
<!--	<div class="swiper-wrapper">-->

<!--	</div>-->
<!--	<div class="pagination"></div>-->
<!--</div>-->

<!--<script src="js/jquery-1.10.1.min.js"></script>-->
<!--<script src="../dist/idangerous.swiper.min.js"></script>-->
<script>
	$("#startTime").calendar(); //开始日期初始化
	$("#endTime").calendar(); //截至日期初始化
	//选择日期
	$(function() {
		$('#startTime').data();
		$('#endTime').data();
	});
	var leafletAddress = `http://221.6.38.163:3300/`
	var jd
	var wd

	// var riversDuties = document.getElementById('riversDuties');
	$(function(){
		$('input[type="text"]').attr('disabled','disabled');
		$('textarea[type="text"]').attr('disabled','disabled');
	});


	let outfallCd = ''
	let userId
	function onResert(){
		let startTime = document.getElementById("startTime");
		let endTime = document.getElementById("endTime");
		startTime.value = ''
		endTime.value=''
	}
	function onQuery(){

		let startTime = document.getElementById("startTime");
		let endTime = document.getElementById("endTime");
		var paramss = {
			"outfallCd":outfallCd,
			"startTime":startTime.value,
			"endTime":endTime.value,
		}
		$.ajax({
			type : 'GET',
			url : 'http://hb.jsslet.com:3050/hh-server/hh-tracing-server/tracing-api/wqExperiment/getJianCValueByOutfallCd',
			contentType : "application/json",
			data : paramss,
			success : function(data, status) {
				addList(data.content)

			},
			error : function(data, status, e) {
				alert('接口调用错误！');
			}
		});
	}
	var mySwiper = new Swiper('.swiper-container',{
		pagination: '.pagination',
		paginationClickable: true
	})

	function myfunction(){
		let strings = window.location.search.split("&");
		let stringsOutfallId = strings[0].split("=");
		let stringsUserId = strings[1].split("=");
		outfallCd = stringsOutfallId[1]
		userId = stringsUserId[1]
		var params = {
			"outfallCd":outfallCd,
		}
		$.ajax({
			type : 'GET',
			url : 'http://hb.jsslet.com:3050/hh-server/hh-tracing-server/tracing-api/wrRiverHead/getOutFallByOutFall',
			contentType : "application/json",
			data : params,
			success : function(data, status) {
				console.log(data)
				if(data){
					if(data.outfallNm == undefined){
						console.log(data.outfallNm)
						data.outfallNm = ''
					}
					if(data.outPicture == undefined){
						data.outPicture = ''
					}
					if(data.outfallClassifyCd == undefined){
						data.outfallClassifyCd = ''
					}
					if(data.tp == undefined){
						data.tp = ''
					}
					if(data.dutyName == undefined){
						data.dutyName = ''
					}
					if(data.waveNm == undefined){
						data.waveNm = ''
					}
					if(data.dischargeStandard == undefined){
						data.dischargeStandard = ''
					}
					if(data.riversLength == undefined){
						data.riversLength = ''
					}
					if(data.riversDuties == undefined){
						data.riversDuties = ''
					}
					if(data.riversPhone == undefined){
						data.riversPhone = ''
					}
					if(data.outfallWave == undefined){
						data.outfallWave = ''
					}
					if(data.jd == undefined){
						data.jd = ''
					}
					if(data.wd == undefined){
						data.wd = ''
					}
					if(data.address == undefined){
						data.address = ''
					}
					if(data.outfallTypeSc == undefined){
						data.outfallTypeSc = ''
					}
					if(data.outfallTypeFi == undefined){
						data.outfallTypeFi = ''
					}


					if(data.sDutyName == undefined){
						data.sDutyName = ''
						document.getElementById('dutyName').innerText='主要责任主体:'+data.dutyName
						// $('#cy').hide()
					}else{
						document.getElementById('dutyName').innerText='主要责任主体:'+data.dutyName+'\n'+ '次要责任主体:'+data.dutyName +'\n';
					}
					if(data.outfallTypeSc == data.outfallTypeFi){
						data.outfallType = data.outfallTypeSc
						$("#fl").show()
						$("#xl").hide()
						$("#fl1").hide()
						$("#dl").hide()
					}else {
						$("#fl").hide()
						$("#fl1").show()
						// $("#xl").show()
						// $("#dl").show()
					}

				}

				document.getElementById('outfallNm').innerText=data.outfallNm;
				document.getElementById('outfallClassifyCd').innerText=data.outfallClassifyCd;
				// document.getElementById('tp').innerText=data.tp;

				document.getElementById('waveNm').innerText=data.waveNm;
				document.getElementById('dischargeStandard').innerText=data.dischargeStandard;
				document.getElementById('rivers').innerText = data.riversLength+' '+data.riversDuties;
				// document.getElementById('riversLength').innerText=data.riversLength;
				// document.getElementById('riversDuties').innerText=data.riversDuties;
				document.getElementById('riversPhone').innerText=data.riversPhone;
				// document.getElementById('outfallWave').innerText=data.outfallWave;
				document.getElementById('jd').innerText=data.jd;
				jd = data.jd
				wd = data.wd
				document.getElementById('wd').innerText=data.wd;
				document.getElementById('address').innerText=data.address;
				document.getElementById('outfallType').innerText=data.outfallType;
				document.getElementById('outfallType1').innerText=data.outfallTypeFi+'-'+data.outfallTypeSc;
				// document.getElementById('outfallTypeSc').innerText=data.outfallTypeSc;
				// document.getElementById('outfallTypeFi').innerText=data.outfallTypeFi;

				console.log(data)
				pictureList = []
				pictureList = JSON.parse(data.outPicture);
				console.log(pictureList)
				for (let i = 0; i < pictureList.length; i++) {
					mySwiper.appendSlide('<div class="title"><img src="'+pictureList[i].url+'" alt="" /></div>')
				}

				var countyvalue = ''
				countyvalue = countyvalue.replace(/(^\s*)|(\s*$)/g, "")
				var paramsss={
					cityvalue:'',
					countyvalue:countyvalue,
					userId:userId
				}

				$.ajax({
					type : 'GET',
					url : 'http://hb.jsslet.com:3050/hh-server/hh-tracing-server/tracing-api/dronesMes/getShpListByUser',
					contentType : "application/json",
					data : paramsss,
					success : function(data, status) {

						var mymap = L.map('waterHomeBaiduMap',{zoomControl: false,}).setView([wd, jd], 15);

						var normalm = L.tileLayer.chinaProvider('GaoDe.Normal.Map', {
							maxZoom: 21,
							minZoom: 12,
							coordType: 'gcj02'
						});

						L.layerGroup([normalm]).addTo(mymap);
						mapCorrection()

						var regionArray = [];

						console.log(data)
						for (let i = 0; i < data.content.region.length; i++) {
							let regionOne = data.content.region[i];
							let a = getStr(regionOne.cover1, ',');
							let b = getStr(regionOne.cover2, ',');
							let regionOptions = {
								layers: regionOne.layers,
								format: 'image/png',
								transparent: true,
								minZoom: 10,
								maxZoom: 21,
								bounds: L.latLngBounds(L.latLng(a.before, a.after), L.latLng(b.before, b.after))
							};
							regionArray.push(L.tileLayer.wms(leafletAddress + 'geoserver/drainage/wms', regionOptions));
						}
						L.layerGroup(regionArray).addTo(mymap);

						var waterArray = [];

						var waterDrainageData = []
						for (let i = 0; i < data.content.water.length; i++) {
							waterDrainageData.push(data.content.water[i])
						}
						console.log(waterDrainageData)
						for (let i = 0; i < waterDrainageData.length; i++) {
							console.log('11111')
							let waterOne = waterDrainageData[i];
							let a = getStr(waterOne.cover1, ',');
							let b = getStr(waterOne.cover2, ',');
							let waterOptions = {
								layers: waterOne.layers,
								format: 'image/png',
								transparent: true,
								minZoom: 10,
								maxZoom: 21,
								bounds: L.latLngBounds(L.latLng(a.before, a.after), L.latLng(b.before, b.after))
							};
							waterArray.push(L.tileLayer.wms(leafletAddress + 'geoserver/drainage/wms', waterOptions));
							L.layerGroup(waterArray).addTo(mymap);
							let transportIcon = L.Icon.extend({
								options: {
									iconSize: [20, 20],
									iconAnchor: [10, 20],
								}
							});
							let myIcon = new transportIcon({iconUrl: './pwk2.png'})
							L.marker([wd, jd], {icon: myIcon}).addTo(mymap);
						}
					},
				});

			},
			error : function(data, status, e) {
				alert('接口调用错误！');
			}
		});



		let startTime = document.getElementById("startTime");
		let endTime = document.getElementById("endTime");
		var paramss = {
			"outfallCd":outfallCd,
			// "startTime":startTime.value,
			// "endTime":endTime.value,
		}
		console.log(paramss)
		$.ajax({
			type : 'GET',
			url : 'http://hb.jsslet.com:3050/hh-server/hh-tracing-server/tracing-api/wqExperiment/getJianCValueByOutfallCd',
			contentType : "application/json",
			data : paramss,
			success : function(data, status) {
				addList(data.content)
			},
			// error : function(data, status, e) {
			//     alert('接口调用错误！');
			// }
		});

	}

	function getStr(string, str) {
		var str_before = string.split(str)[0];
		var str_after = string.split(str)[1];
		var obj = {
			before: str_before,
			after: str_after
		};
		return obj;
	}

	// 解决加载高德路况偏移问题
	function mapCorrection() {
		L.GridLayer.include({
			_setZoomTransform: function (level, center, zoom) {
				if (center != undefined && this.options) {
					// 把鼠标坐标由WGS84坐标系转为DB09或GCJ02坐标系，leaflet从图面上获取的坐标是WGS84坐标系的，需要转换到瓦片对应的坐标系，才能匹配瓦片
					if (this.options.coordType == 'gcj02') {
						center = L.coordTransform().wgs84_To_gcj02(center.lng, center.lat);
					} else if (this.options.coordType == 'bd09') {
						center = L.coordTransform().wgs84_To_bd09(center.lng, center.lat);
					}
				}
				var viewHalf = this._map.getSize().divideBy(2);
				var mapProject = this._map.project(center, zoom);
				var mapPanePos = this._map._mapPane._leaflet_pos;
				var newPixelOrigin = mapProject.subtract(viewHalf)._add(mapPanePos).round();
				var scale = this._map.getZoomScale(zoom, level.zoom),
						translate = level.origin.multiplyBy(scale)
								.subtract(newPixelOrigin).round();
				if (L.Browser.any3d) {
					L.DomUtil.setTransform(level.el, translate, scale);
				} else {
					L.DomUtil.setPosition(level.el, translate);
				}
			},
			// 获取地图容器像素四至，根据修改后的鼠标中心点获取
			_getTiledPixelBounds: function (center) {
				if (center != undefined && this.options) {
					if (this.options.coordType == 'gcj02') {
						center = L.coordTransform().wgs84_To_gcj02(center.lng, center.lat);
					} else if (this.options.coordType == 'bd09') {
						center = L.coordTransform().wgs84_To_bd09(center.lng, center.lat);
					}
				}
				var map = this._map,
						mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),
						scale = map.getZoomScale(mapZoom, this._tileZoom),
						pixelCenter = map.project(center, this._tileZoom).floor(),
						halfSize = map.getSize().divideBy(scale * 2);
				return new L.Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));
			}
		})
		L.CoordTransform = function () {
			//bd09转wgs84
			this.bd09_To_wgs84 = function (lng, lat) {
				var gcj02 = this.bd09_To_gcj02(lng, lat);
				var wgs84 = this.gcj02_To_wgs84(gcj02.lng, gcj02.lat);
				return wgs84;
			}
			//wgs84转bd09
			this.wgs84_To_bd09 = function (lng, lat) {
				var gcj02 = this.wgs84_To_gcj02(lng, lat);
				var bd09 = this.gcj02_To_bd09(gcj02.lng, gcj02.lat);
				return bd09;
			}
			//wgs84转gcj02
			this.wgs84_To_gcj02 = function (lng, lat) {
				var dLat = transformLat(lng - 105.0, lat - 35.0);
				var dLng = transformLng(lng - 105.0, lat - 35.0);
				var radLat = lat / 180.0 * pi;
				var magic = Math.sin(radLat);
				magic = 1 - ee * magic * magic;
				var sqrtMagic = Math.sqrt(magic);
				dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
				dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
				var mgLat = lat + dLat;
				var mgLng = lng + dLng;
				var newCoord = {
					lng: mgLng,
					lat: mgLat
				};
				return newCoord;
			}
			//gcj02转wgs84
			this.gcj02_To_wgs84 = function (lng, lat) {
				var coord = transform(lng, lat);
				var lontitude = lng * 2 - coord.lng;
				var latitude = lat * 2 - coord.lat;
				var newCoord = {
					lng: lontitude,
					lat: latitude
				};
				return newCoord;
			}
			//gcj02转bd09
			this.gcj02_To_bd09 = function (lng, lat) {
				var z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_pi);
				var theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_pi);
				var bd_lng = z * Math.cos(theta) + 0.0065;
				var bd_lat = z * Math.sin(theta) + 0.006;
				var newCoord = {
					lng: bd_lng,
					lat: bd_lat
				};
				return newCoord;
			}
			//bg09转gcj02
			this.bd09_To_gcj02 = function (lng, lat) {
				var x = lng - 0.0065;
				var y = lat - 0.006;
				var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
				var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
				var lontitude = z * Math.cos(theta);
				var latitude = z * Math.sin(theta);
				var newCoord = {
					lng: lontitude,
					lat: latitude
				};
				return newCoord;
			}
			var pi = 3.1415926535897932384626;
			var a = 6378245.0;
			var ee = 0.00669342162296594323;
			var x_pi = pi * 3000.0 / 180.0;
			var R = 6378137;

			function transform(lng, lat) {
				var dLat = transformLat(lng - 105.0, lat - 35.0);
				var dLng = transformLng(lng - 105.0, lat - 35.0);
				var radLat = lat / 180.0 * pi;
				var magic = Math.sin(radLat);
				magic = 1 - ee * magic * magic;
				var sqrtMagic = Math.sqrt(magic);
				dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
				dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
				var mgLat = lat + dLat;
				var mgLng = lng + dLng;
				var newCoord = {
					lng: mgLng,
					lat: mgLat
				};
				return newCoord;
			}

			function transformLat(x, y) {
				var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
				ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
				ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
				ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
				return ret;
			}

			function transformLng(x, y) {
				var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
				ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
				ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
				ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0;
				return ret;
			}
		}
		L.coordTransform = function () {
			return new L.CoordTransform();
		}
	}

	function addList(list){

		var str = ''
	
		
		//console.log($("#addList").children().length)
		if(list.length == 0 ){
			for (let i = $("#addList").children().length-1; i >=0 ; i--) {
				$("#addList").children().get(i).remove()
			}

			str = str + '<view class="tr" >\n' +
					'                            <view class="td"></view>\n' +
					'                            <view class="td"></view>\n' +
					'                            <view class="td"></view>\n' +
					'                            <view class="td"></view>\n' +
					'                        </view>'
			$("#addList").children().get(
					$("#addList").children().length-1
			)
			$("#addList").append(str);
		}else{

			// let elementsByTagName = document.getElementById("addList").getElementsByTagName("view");
			// for (let i = 0; i < document.getElementById("addList").getElementsByTagName("view").length; i++) {
			//     document.getElementById("addList").getElementsByTagName("view")[i].remove()
			// }
			for (let i = $("#addList").children().length-1; i >=0 ; i--) {
				$("#addList").children().get(
						i
				).remove()
			}
			
			for (let i = 0; i < list.length; i++) {
				var strTm = ''   
				if(list[i].tm.length>10){
					strTm = list[i].tm.substring(0, 10)
				}else{
					strTm = list[i].tm
				}
	

				str = str + '<view class="tr" >\n' +
						'                            <view class="td">'+list[i].name+'</view>\n' +
						'                            <view class="td">'+strTm+'</view>\n' +
						'                            <view class="td">'+list[i].value+'</view>\n' +
						'                            <view class="td">'+list[i].upValue+'</view>\n' +
						'                        </view>'
			}

			$("#addList").append(str);
		}


	}
	function showSamplingTankList(){
		url = "addOnlineMonitoring.html?outfallCd="+outfallCd+'&userId=' + userId;//此处拼接内容
		window.location.href = url;
	}


</script>
</body>
</html>
